<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    //强制转换
   console.log( typeof Number('123'));
   console.log( Number('{}'));
   console.log(Number('abc'));
   //////////////////////////
   console.log(Number(123));//数值转换后还是原来的数值
   console.log(Number('123'));//字符串，如果可以转换为数值，则转换为相应的数值
   console.log(Number('123abc'));//不可以被解析为数值，则返回NaN
   console.log(Number(''));//空字符则为0
   console.log(Number(true));//true转换为1，false为0
   console.log(Number(false));
   console.log(Number(undefined));//转成NaN
   console.log(Number(null));//转成0
   //string同Number一样，强制转换,全部转换成字符串，无论是什么。
   console.log(String(123));
   console.log(Boolean('123'));//boolean函数:除了undefined,null,空字符(''),-0,+0,NaN为false,其他的都是true
</script>